/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.IOException;

/**
 *
 * @author Okuhama
 */
public class Imagem extends BufferedImage{
    private Point local;
    private int posicao;
    private String id;
    private BufferedImage img;
    private Point localFixo;
    private String idTitle;

    public Imagem(Point local, String id, BufferedImage img) throws IOException {
        super(AreaGrafica.img[0][0].getWidth(), AreaGrafica.img[0][0].getHeight(), TYPE_INT_RGB);
        Graphics g = createGraphics();
        this.local = local;
        this.setId(id);
        this.img = img;
        g.drawImage(this.img, 1, 1, null);
    }
    
    public Imagem(Point local, int posicao, BufferedImage img, String idTitle) throws IOException {
        super(AreaGrafica.img[0][0].getWidth(), AreaGrafica.img[0][0].getHeight(), TYPE_INT_RGB);
        Graphics g = createGraphics();
        this.local = local;
        this.posicao = posicao;
        this.img = img;
        this.setIdTitle(idTitle);
        g.drawImage(this.img, 1, 1, null);
    }
    
    public Imagem(Point local, Point localFixo, String id, BufferedImage img) throws IOException {
        super(AreaGrafica.img[0][0].getWidth(), AreaGrafica.img[0][0].getHeight(), TYPE_INT_RGB);
        Graphics g = createGraphics();
        this.local = local;
        this.setId(id);
        this.img = img;
        this.setLocalFixo(localFixo);
        g.drawImage(this.img, 1, 1, null);
      
    }

    public Imagem(Point local, int posicao) {
        super(50, 50, TYPE_INT_RGB);
        this.local = local;
        this.posicao = posicao;
        Graphics g = createGraphics();
        g.setColor(Color.white);
        g.fillRect(0, 0, 50, 50);
        g.setColor(Color.black);
        g.drawRect(0, 0, 50, 50);
    }

    public void setLocal(Point local) {
        this.local = local;
    }

    public void setposicao(int posicao) {
        this.posicao = posicao;
    }

    public Point getLocal() {
        return local;
    }

    public int getposicao() {
        return posicao;
    }

	public BufferedImage getImg() {
		return img;
	}

	public void setImg(BufferedImage img) {
		this.img = img;
	}

	public Point getLocalFixo() {
		return localFixo;
	}

	public void setLocalFixo(Point localFixo) {
		this.localFixo = localFixo;
	}

	public String getIdTitle() {
		return idTitle;
	}

	public void setIdTitle(String idTitle2) {
		this.idTitle = idTitle2;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

    

}
